<template>
  <!-- 种母期初 -->
  <div>
    种母耳号：<el-input style="width: 180px"></el-input>
    转种日期：<el-date-picker style="width: 180px"></el-date-picker>--
    <el-date-picker style="width: 180px"></el-date-picker>
    <el-button type="danger">查询</el-button>
  </div>
  <el-table
    :header-cell-style="{
      height: '100px',
      fontSize: '13px',
      color: 'black',
      backgroundColor: 'antiquewhite'
    }"
    :data="tableData"
    border
    style="width: 100%"
  >
    <el-table-column prop="femaleBeginId" label="序号" />
    <el-table-column prop="femaleBeginId" label="单据号" />
    <el-table-column prop="transplainData" label="期初日期">
      <template v-slot="scope">
        <span>{{ scope.row.transplainData.substr(0, 10) }}</span>
      </template>
    </el-table-column>
    <el-table-column prop="sleepInforId" label="耳号" />
    <el-table-column prop="cottageName" label="栋舍名称" />
    <el-table-column prop="fieIdName" label="栏位" />
    <el-table-column prop="femaleBeginWeight" label="重量（公斤）" />
    <el-table-column prop="createId" label="创建人" />
    <el-table-column prop="createTime" label="创建时间">
      <template v-slot="scope">
        <span>{{ scope.row.createTime.substr(0, 10) }}</span>
      </template>
    </el-table-column>
    <el-table-column prop="updateId" label="修改人" />
    <el-table-column prop="updateTime" label="修改时间">
      <template v-slot="scope">
        <span>{{ scope.row.updateTime.substr(0, 10) }}</span>
      </template>
    </el-table-column>
    <el-table-column prop="deleteId" label="审核人" />
    <el-table-column prop="deleteTime" label="审核时间">
      <template v-slot="scope">
        <span>{{ scope.row.deleteTime.substr(0, 10) }}</span>
      </template>
    </el-table-column>
    <el-table-column label="操作" />
  </el-table>
</template>

<script setup lang="ts">
import { reactive, ref, onMounted } from 'vue';
import axios from 'axios';
import { useRoute, useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
const route = useRoute();
const router = useRouter();

const tableData = ref([]);

const form = reactive({
  sleepInforId: '',
  start: '',
  end: ''
});

const getData = () => {
  axios
    .post('http://localhost:5039/api/SleepBegin/Handle/SelectFemaleBegin', {
      sleepInforId: form.sleepInforId || 0,
      start: form.start || '',
      end: form.end || ''
    })
    .then((res) => {
      tableData.value = res.data.data;
    });
};

onMounted(() => {
  getData();
});
</script>

<style scoped></style>
